Skip to content

fix(docs): Prevent trailing slash in example path from causing validation error - #1224

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/docs-example-path-validation
Open

fix(docs): Prevent trailing slash in example path from causing validation error#1224
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/docs-example-path-validation

Conversation

@sentry

@sentry sentry Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This PR fixes an issue where navigating to an examples index URL (e.g., /table/v8/docs/framework/react/examples) would result in a validation error.

The root cause was that when the _splat parameter was empty (indicating the examples index), the path construction [framework, params._splat].join('/') would produce a trailing slash (e.g., "react/"). This trailing slash then caused the repoPathSchema validator in fetchRepoDirectoryContents to reject the path, leading to the observed error.

The fix involves adding .filter(Boolean) to the path construction:
[framework, params._splat].filter(Boolean).join('/')

This ensures that empty segments (like an empty _splat) are filtered out before joining, preventing the creation of a trailing slash and allowing the path to pass validation.

Fixes TANSTACK-COM-3G1

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com f586af4 Commit Preview URL

Branch Preview URL
Sep 05 2026, 11:04 PM

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Sep 6, 2026
@tannerlinsley

Copy link
Copy Markdown
Member

The source audit found that this duplicates #1197. Both fix the same loader expression and reported validation failure, while #1197 also normalizes the two remaining example paths used by deploy and repository links. I recommend closing this one and reviewing #1197 so only one coherent fix lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant